export default defineEventHandler(async (event) => {
  const id = getRouterParam(event, 'id')
  
  // 模拟生成下载链接
  const downloadUrl = `https://example.com/downloads/product-${id}.zip`
  const filename = `product-${id}-source-code.zip`
  
  console.log(`生成下载链接: ${id}`)
  
  return {
    code: 200,
    message: 'success',
    data: {
      downloadUrl,
      filename,
      expiresAt: new Date(Date.now() + 3600000).toISOString(), // 1小时后过期
    },
  }
})

